In general, a hydraulic excavator used as a construction machine includes a lower travel structure, an upper swing structure, and a multi-joint work machine. The upper swing structure is swingably mounted on the lower travel structure. The multi-joint work machine is elevatably mounted on the upper swing structure and provided with a boom, an arm, and a bucket. The hydraulic excavator also includes, for example, a hydraulic pump, a plurality of hydraulic actuators (or more specifically, a boom hydraulic cylinder, an arm hydraulic cylinder, a bucket hydraulic cylinder, etc.), and a plurality of directional control valves. The hydraulic actuators are driven by hydraulic fluid discharged from the hydraulic pump. The directional control valves control the flow of hydraulic fluid, which flows from the hydraulic pump to the hydraulic actuators, in accordance with operations performed by a plurality of operating devices.
An electrically-operated hydraulic excavator (refer, for instance, to Patent Documents 1 and 2) proposed in recent years includes an electric motor as a drive source in place of an engine because the electric motor is at an advantage in that it emits no exhaust gas and significantly reduces noise and vibration. The electrically-operated hydraulic excavator includes a swing electric motor or hydraulic motor and a travel electric motor or hydraulic motor in addition to the aforementioned boom hydraulic cylinder, arm hydraulic cylinder, and bucket hydraulic cylinder. Further, the electrically-operated hydraulic excavator includes, for example, a battery as an electrical power source for the electric motor included in the electrically-operated hydraulic excavator.
For instance, as described in Patent Document 1, the above-mentioned electrically-operated hydraulic excavator with a battery is configured so that a cable from a commercial power source (external power source) can be connected to a feed port provided on a lateral surface of the upper swing structure (namely, on the outside of a cab). Further, for instance, as described in Patent Document 2, a switch capable of dictating battery charge is equipped in the cab. A power supply system incorporated in the electrically-operated hydraulic excavator has a motor control function for driving the electric motor by controlling the electrical power supplied from the battery and a charge control function for converting AC power supplied from the commercial power source to DC power and charging the battery, and exercises battery charge control in accordance with the dictation of the switch.